//
//  OrderSubmitCell.m
//  AnnCar_user
//
//  Created by LiBenCan on 17/10/24.
//  Copyright © 2017年 LiBenCan. All rights reserved.
//

#import "OrderSubmitCell.h"
#import "UILabel+HWDUILabel.h"
@implementation OrderSubmitCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = 0;
        [self CreatUI];
    }
    return self;
}

//创建视图
- (void)CreatUI
{
    if (!_imageV) {
        //前部图片
        _imageV = [UIImageView new];
        [self.contentView addSubview:_imageV];
        [_imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.contentView).offset(15 * screenW_6);
            make.top.equalTo(self.contentView).offset(15*screenW_6);
            make.height.width.equalTo(@(40*screenW_6));
            make.bottom.equalTo(self.contentView).offset(-15*screenW_6);
        }];

        //种类
        _kindLab = [UILabel new];
        [self.contentView addSubview:_kindLab];
        [_kindLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.imageV.mas_right).offset(10 * screenW_6);
            make.top.equalTo(self.contentView).offset(15*screenW_6);
            make.height.equalTo(@(40*screenW_6));
            make.width.equalTo(@(SCREENW/2));
        }];
        
        //箭头
        _arrowImageV = [UIImageView new];
        [self.contentView addSubview:_arrowImageV];
        _arrowImageV.image = [UIImage imageNamed:@"My_arrow"];
        [_arrowImageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.contentView).offset(28*screenW_6);
            make.height.equalTo(@(14*screenW_6));
            make.width.equalTo(@(8*screenW_6));
            make.right.equalTo(@(-15*screenW_6));
        }];

        //金额
        _moneyLab = [UILabel new];
        _moneyLab.textColor = TextRed;
        _moneyLab.font = [UIFont systemFontOfSize:19*screenW_6];
        _moneyLab.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:_moneyLab];
        [_moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.kindLab.mas_right).offset(15 * screenW_6);
            make.top.equalTo(self.contentView).offset(15*screenW_6);
            make.height.equalTo(@(40*screenW_6));
            make.right.equalTo(_arrowImageV.mas_left).offset(-10*screenW_6);
        }];
        
        
    }
}
//数据字典
-(void)setDataDic:(NSDictionary *)dataDic{
    _imageV.image = [UIImage imageNamed:@"orderNei"];
    _kindLab.text = [ToolViewVC getNotNullStr:@"精洗"];
    _moneyLab.text = [NSString stringWithFormat:@"¥ %@",[ToolViewVC getNotNullStr:@"91"]];
    [_moneyLab setTextFont:@"¥" font:[UIFont systemFontOfSize:12*screenW_6]];
    
}

@end
